package edu.zut.bailan.cart.domain;

import edu.zut.bailan.base.domain.BaseTreeEntity;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import java.util.Set;

public class CartGroup extends BaseTreeEntity<CartGroup, Long> {

    /**
     *
     */
    private static final long serialVersionUID = 5793044840120005316L;

    /**
     * code of edu.zut.bailan.cart
     */
    @Column(name = "CODE")
    String code;

    /**
     * price for cartgroup
     */
    @Column(name = "PRICE")
    Integer price;

    @OneToMany(mappedBy = "cartGroup", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    Set<Cart> carts;


    public Set<Cart> getCarts() {
        return carts;
    }

    public void setCarts(Set<Cart> carts) {
        this.carts = carts;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getPrice() {
        return price;
    }


    public void setPrice(Integer price) {
        this.price = price;
    }
}
